home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
VISUALBA
/
BOZOL2.ZIP
/
CALC.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-02-08
|
777b
|
19 lines
CASE "CALC","EVAL","WHAT"
' Build an expression to calculate by stringing together
' all pushed arguments that may constitute an arithmetic
' expression. When we come to a non arithmetic symbol or
' bit of text, push it back and calculate what we have.
A$=""
DO
B$=POPARG$
IF VERIFY(B$,"01234567890 .+-/\*^()><=") THEN
PUSHARG B$
EXIT LOOP
END IF
A$=A$+B$
LOOP WHILE ArgPtr%>0
PUSHARG STR$(CALC(A$))
CASE "+","-","/","\","*","^","(",")",">","<","=","&"
PUSHARG PRG$